//
//  OPShortcutConfigSectionHead.m
//  LCGOptimusPrime
//
//  Created by 罗腾 on 2017/7/30.
//  Copyright © 2017年 erics. All rights reserved.
//

#import "OPShortcutConfigSectionHead.h"
#import "UIColor+number.h"
#import "Masonry.h"
static CGFloat margX = 15.0f;

@interface OPShortcutConfigSectionHead ()
{
    UILabel *titleLab;
    UILabel *subTItleLab;
}

@end
@implementation OPShortcutConfigSectionHead


-(instancetype)initWithFrame:(CGRect)frame{
    if ([super initWithFrame:frame]) {
        [self buidUI];
    }return self;
}



- (void)buidUI{
    
    UIView * lineView = [[UIView alloc]init];
    lineView.backgroundColor = [UIColor hexStringToColor:@"#ff6a41"];
    [self addSubview:lineView];
    
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.centerY.equalTo(self);
        make.width.mas_equalTo(2);
        make.height.mas_equalTo(15);
    }];
    
    titleLab = [[UILabel alloc]init];
    [self addSubview:titleLab];
    [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(lineView.mas_right).offset(12);
        make.centerY.equalTo(self);
    }];
    titleLab.font = [UIFont systemFontOfSize:16];
    titleLab.textColor = [UIColor hexStringToColor:@"#333333"];
    
    subTItleLab = [[UILabel alloc]init];
    [self addSubview:subTItleLab];
    [subTItleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(titleLab.mas_right).offset(7);
        make.bottom.equalTo(titleLab);   
    }];
    subTItleLab.font = [UIFont systemFontOfSize:13];
    subTItleLab.textColor = [UIColor hexStringToColor:@"#999999"];
    
}

- (void)setTitle:(NSString *)title{
    _title = title;
    titleLab.text = _title;
    
}

- (void)setSubTitle:(NSString *)subTitle{
    
    _subTitle = subTitle;
    subTItleLab.text = _subTitle;
    
}

@end
